<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>产品</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<style>
		html{ padding: 10px}
	</style>
	<link rel="stylesheet" href="{:_SKIN}/user/css/bootstrap.min.css" media="all"/>
</head>
<body class="childrenBody">

<div>
	<!-- <img src="http://img.hf0557.com/2017/09/30/FnykQmiB7lppueJQXbKFwzQ362dS308.jpg" width="100%" />
	<div style="font-size: 16px;margin-bottom: 10px;">提现金额</div> -->
	<!-- <div id="app"><input type="text" id="money"  name="money" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" placeholder="¥"></div> -->
	<!-- <div><span  id="balance">{$result}</span><span>元</span></div> -->
	<div class="input-group" style="margin-bottom: 30px;margin-top: 30px;">
	  	<span class="input-group-addon">需提现金额&nbsp;&nbsp;￥</span>
	  	<div id="app"><input type="number" class="form-control" aria-label="Amount (to the nearest dollar)" id="money" name="money" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');"></div>
	  	<span class="input-group-addon">.00</span>
	</div>
	<div class="input-group">
	  	<span class="input-group-addon">可提现金额&nbsp;&nbsp;￥</span>
	  	<!-- <input type="text" class="form-control" aria-label="Amount (to the nearest dollar)" id="balance" value="{$result}" disabled="disabled"> -->
	  	<!-- <div style="border: 1px solid #ccc;height: 33px;line-height: 33px;"><span id="balance"></span>{$result}<span>元</span></div> -->
	  	<div style="border: 1px solid #ccc;height: 33px;line-height: 33px;"><span  id="balance">{$result}</span><span>元</span></div>
	 	<span class="input-group-addon">.00</span>
	</div>

	<div id="orderinfo"></div>
	<div id="getinfo">
		{volist name="bid" id="vo"}
		<span id="bid" style="display: none">{$vo.id}</span>
		<span id="bname" style="display: none">{$vo.qymc}</span>
		<span id="uid" style="display: none">{$vo.uid}</span>
		<span id="uname" style="display: none" >{$vo.qyfr}</span>
		<span id="kh" style="display: none" >{$vo.kh}</span>
		<span id="khh" style="display: none" >{$vo.khh}</span>
		{/volist}
	</div>
	<div>
		
		<span style="color:red"><h5>提现金额将自动扣除百分之15手续费计算</h5></span>
	</div>
	<button onclick="verify()" style="margin-top: 30px;" class="btn btn-success btn-lg btn-block">提现</button> 
</div>

<script src="{:_SKIN}/index/login/js/jquery-2.2.4.min.js"></script>
<script src="{:_SKIN}/weixin/car/js/vue.min.js" type="text/javascript"></script>
<script src="{:_SKIN}/weixin/car/js/axios.min.js" type="text/javascript"></script>
<script type="text/javascript">
</script>
<script>
	// $(function(){
	// 	$(document).on('change',function(){
	// 		var order = $('#money').val();
	// 		var a = $('#balance').text()-order;
	// 		$('#balance').html(a)
	// 	})
	// })
	$(function(){
		$("#money").bind('input porpertychange',function(){
			var money = $('#money').val();
			// var money = $('#money').val();
			// console.log(money)
			// console.log({$result})
			return (parseInt(money)-parseInt({$result}))
			// if (parseInt(money)>parseInt({$result})) {
			// 	// $('#money').val() = parseInt({$result})
			// 	console.log(parseInt(money)-parseInt({$result}))
			// }
		});
	})

	// $('document').change(function(){
	// 	var money = $('#money').val();
	// 	if ((parseInt(money)-parseInt({$result}))>0) {
	// 		$('#money').val() = parseInt({$result})
	// 	}
	// })


	$('#money').change(function(){
		var order = $('#money').val();
		var a = $('#balance').text()-order;
		//alert(a)
		$('#balance').html(a)
	})


	function verify()
	{
		var money = $('#money').val();
		// alert(money)
		var getinfo = $('#getinfo').text();
		var bid = $('#bid').text();
		var bname = $('#bname').text();
		var uid = $('#uid').text();
		var uname = $('#uname').text();
		var balance = $('#balance').text();
		var kh = $('#kh').text();
		var khh = $('#khh').text();

		if (money) {
			if (confirm('确认提现?提现后现金将于3-5个工作日到底您的账户。')){
				$.ajax({
				type:"POST",
				url:"{:url('user/Seller/getgoods')}",
				dataType: 'json',
				data:{bid:bid,bname:bname,uid:uid,uname:uname,money:money,balance:balance,kh:kh,khh:khh}

			})
				alert('提现成功');
				window.location.href = 'checkthe/seller/user';
			}
			
		}
	}
</script>
</body>
</html>